package ar.com.nexttome;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;
import ar.com.nexttome.context.ApplicationContext;
import ar.com.nexttome.entities.Mensaje;
import ar.com.nexttome.entities.Persona;
import ar.com.nexttome.util.Constantes;
import ar.com.nexttome.util.MensajeArrayAdapter;
import ar.com.nexttome.util.Tools;

public class MensajesActivity extends Activity {
	Persona personaSeleccionada = null;

	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.list);

		Tools.createActionMenu(this, Constantes.STR_MENSAJES, PerfilActivity.class, R.drawable.ic_title_home_default);

		Persona yo = ((ApplicationContext) this.getApplicationContext()).getCurrentUser();
		List<Mensaje> listMensajes = PersonaManager.getMensajes(yo.getId());

		ListAdapter adapter = new MensajeArrayAdapter(this, listMensajes);
		final ListView lv = (ListView) this.findViewById(R.id.listView1);
		lv.setAdapter(adapter);
	}

}
